package com.teamone.addressbook;

import com.teamone.addressbook.Control.AddressCtrl;
import com.teamone.addressbook.Model.DeleteAddrEty;
import com.teamone.addressbook.Model.ModifyAddrEty;
import com.teamone.addressbook.Model.RegisterAddrEty;
import com.teamone.addressbook.Model.RetrieveAddrEty;
import com.teamone.addressbook.Utilities.Utility;
import com.teamone.addressbook.View.AddressBook;
import com.teamone.addressbook.View.ModifyDialog;


public class AddressVO {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Utility util = new Utility();
		AddressCtrl controller = new AddressCtrl();
		
		AddressBook addressbook = new AddressBook(controller);
		ModifyDialog modifydialog = new ModifyDialog(addressbook, controller);
		
		RegisterAddrEty registeraddr = new RegisterAddrEty(util);
		ModifyAddrEty modifyaddr = new ModifyAddrEty(util);
		RetrieveAddrEty retrieveaddr = new RetrieveAddrEty(util);
		DeleteAddrEty deleteaddr = new DeleteAddrEty(util);
		
		try
		{			
			controller.addModel(registeraddr);
			controller.addModel(modifyaddr);
			controller.addModel(retrieveaddr);
			controller.addModel(deleteaddr);
			
			controller.addView(addressbook);
			controller.addView(modifydialog);
		}
		catch (ClassNotFoundException e)
		{
			System.out.println("Failed to add one or more of models/views");
			System.out.println(e.getMessage());
		}
	}

}
